package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "medicalRecord", schema = "gp2022", catalog = "")
public class MedicalRecordBean {
    private int medicalRecordId;
    private Integer patientId;
    private String patientName;
    private Integer diseaseId;
    private Timestamp startTime;
    private Timestamp reportTime;
    private Integer reporterId;
    private Timestamp reporterName;
    private Timestamp endTime;
    private String symptom;
    private Integer patientState;

    @Id
    @Column(name = "medicalRecordId")
    public int getMedicalRecordId() {
        return medicalRecordId;
    }

    public void setMedicalRecordId(int medicalRecordId) {
        this.medicalRecordId = medicalRecordId;
    }

    @Basic
    @Column(name = "patientId")
    public Integer getPatientId() {
        return patientId;
    }

    public void setPatientId(Integer patientId) {
        this.patientId = patientId;
    }

    @Basic
    @Column(name = "patientName")
    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    @Basic
    @Column(name = "diseaseId")
    public Integer getDiseaseId() {
        return diseaseId;
    }

    public void setDiseaseId(Integer diseaseId) {
        this.diseaseId = diseaseId;
    }

    @Basic
    @Column(name = "startTime")
    public Timestamp getStartTime() {
        return startTime;
    }

    public void setStartTime(Timestamp startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "reportTime")
    public Timestamp getReportTime() {
        return reportTime;
    }

    public void setReportTime(Timestamp reportTime) {
        this.reportTime = reportTime;
    }

    @Basic
    @Column(name = "reporterId")
    public Integer getReporterId() {
        return reporterId;
    }

    public void setReporterId(Integer reporterId) {
        this.reporterId = reporterId;
    }

    @Basic
    @Column(name = "reporterName")
    public Timestamp getReporterName() {
        return reporterName;
    }

    public void setReporterName(Timestamp reporterName) {
        this.reporterName = reporterName;
    }

    @Basic
    @Column(name = "endTime")
    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    @Basic
    @Column(name = "symptom")
    public String getSymptom() {
        return symptom;
    }

    public void setSymptom(String symptom) {
        this.symptom = symptom;
    }

    @Basic
    @Column(name = "patientState")
    public Integer getPatientState() {
        return patientState;
    }

    public void setPatientState(Integer patientState) {
        this.patientState = patientState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MedicalRecordBean that = (MedicalRecordBean) o;

        if (medicalRecordId != that.medicalRecordId) return false;
        if (patientId != null ? !patientId.equals(that.patientId) : that.patientId != null) return false;
        if (patientName != null ? !patientName.equals(that.patientName) : that.patientName != null) return false;
        if (diseaseId != null ? !diseaseId.equals(that.diseaseId) : that.diseaseId != null) return false;
        if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false;
        if (reportTime != null ? !reportTime.equals(that.reportTime) : that.reportTime != null) return false;
        if (reporterId != null ? !reporterId.equals(that.reporterId) : that.reporterId != null) return false;
        if (reporterName != null ? !reporterName.equals(that.reporterName) : that.reporterName != null) return false;
        if (endTime != null ? !endTime.equals(that.endTime) : that.endTime != null) return false;
        if (symptom != null ? !symptom.equals(that.symptom) : that.symptom != null) return false;
        if (patientState != null ? !patientState.equals(that.patientState) : that.patientState != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = medicalRecordId;
        result = 31 * result + (patientId != null ? patientId.hashCode() : 0);
        result = 31 * result + (patientName != null ? patientName.hashCode() : 0);
        result = 31 * result + (diseaseId != null ? diseaseId.hashCode() : 0);
        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
        result = 31 * result + (reportTime != null ? reportTime.hashCode() : 0);
        result = 31 * result + (reporterId != null ? reporterId.hashCode() : 0);
        result = 31 * result + (reporterName != null ? reporterName.hashCode() : 0);
        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
        result = 31 * result + (symptom != null ? symptom.hashCode() : 0);
        result = 31 * result + (patientState != null ? patientState.hashCode() : 0);
        return result;
    }
}
